package com.li.sssp.cp;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.li.sssp.cp.model.GameData;

@Service
public class CPServer {

	@Autowired
	private CPRepository cprepository;
	
	public List<GameData> getAll(){
		return cprepository.findAll();
	}
	
	@Transactional
	public void Save(List<GameData> GameDatas){
		for (GameData gameData : GameDatas) {
			cprepository.saveAndFlush(gameData);	
		}
	}
}
